<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 初始化页面 */
        *{
            padding: 0;
            margin: 0;
        }

        /* 设置弹性盒子模型，使内容居中,让容器的宽度和高度充满全屏 */
        html,body{
            width: 100%;
            height: 100%;
            background-color: pink;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .square{
            width: 200px;
            height: 200px;
            background-color: yellow;
            position: relative;
            transform: rotate(45deg);
            box-shadow: 0 0 50px gold;
            animation: heart 1s linear 0s infinite alternate none;
            z-index: 5;
        }

        .square::before{
            /* 没有 content 属性，伪元素不会被渲染到页面上 */
            content: "";
            width: 100px;
            height: 200px;
            background-color: yellow;
            position: absolute;
            left: -99px;
            border-radius: 100px 0 0 100px; 
            box-shadow: 0 0 50px gold;
            z-index: 1;
        }

        .square::after{
            /* 没有 content 属性，伪元素不会被渲染到页面上 */
            content: "";
            width: 200px;
            height: 100px;
            background-color: yellow;
            position: absolute; 
            top: -99px;
            border-radius: 100px 100px 0 0px;
            box-shadow: 0 0 50px gold;
            z-index: 1;
        }

        @keyframes heart {
            0%{
                transform: rotate(45deg) scale(0.6);
            }
            50%{
               transform: rotate(45deg) scale(1);
            }
            100%{
                transform:rotate(45deg) scale(1.2);
            }
        }
        




    </style>



</head>

<body>
    <div class="square"></div>



</body>

</html>